<?php 
	//$this->firephp->log($classes,'classes');
?>


<div id="bodyLeftContainer"> 
		<!--  
		<ul class="nav nav-pills nav-stacked">
			<li>
				<a href="#">school 1</a>
			</li>
			<li class="active">
				<a href="#">school 2</a>
			</li>
		</ul>
		-->
		<?php echo $schoolListMenu;?>
	</div>

<div id="tableContainer">

	

	<?php 
	
	//$this->firephp->log($schoolListMenu);
	//$this->firephp->log($offers,'offers');
	//$this->firephp->log($classes,'classes');
	//$this->firephp->log($user);
 	//$this->chromephp->log($offers);
 	//$this->chromephp->log($user);
	
	if ( isset($classes) && count($classes) != 0 ) {
		
		?>
		<table>
			<thead>
				<th>oferta</th>
				<th>escola</th>
				<th>Preço</th>
				<th>nivel</th>
				<th>aulas</th>
				<th>lugares</th>
				<th>vagas</th>
				<th></th>
			</thead>
			<tbody>
		<?php		
		
		// display all available classes for the school associate to this hotel
		foreach ($classes as $value) {
			?>
				<tr>
					<td>
						<?php 
							// link with offer name
							echo anchor(
								"Hotel/offer",
								$value->name,
								array(
									'class' 		=>'offerName',
									'data-offerId'	=>$value->offer_id,
									'data-classId'	=>$value->class_id,
									'data-userId'	=>$user->id
								)
							);
						?>
					</td>
					<td><?php echo $value->schoolName;?></td>
					<td><?php echo $value->price;?></td>
					<td><?php echo $value->level;?></td>
					<td>
						<?php 
							// link with the number of classes
							echo anchor(
								"Hotel/classes",
								$value->numberOfClasses,
								array(
									'class'			=>'classes',
									'data-offerId'	=>$value->offer_id,
									'data-classId'	=>$value->class_id,
									'data-userId'	=>$user->id
								)
							);
						?>
					</td>
					<td>
						<?php 
							echo $value->maxPart;
						?>
					</td>
					<td>
						<?php 
							echo $value->spots;
						?>
					</td>
					<td>
						<?php 
							// link to make reservation
							if ($value->spots) {
								echo anchor('Hotel/reservation/'.$value->class_id,'reservar');
							}
						?>	
					</td>
				</tr>
			<?php 
		}		
		?>
			</tbody>
			</table>
		<?php
	}
	else {
		?><p><?php echo "Nao existem ofertas disponiveis nesta escola";?></p><?php 
	}
	?>
</div>	




<!--  
<div id="tmpAction">
	tmp action
</div>
-->







<script>

	
</script>




<div id="popUpCalendarDialog" class="dialog" title="calendario">
	<!--  
	<div class="cal-container">
		<div class="cal-class-label 	inside-cal-container"><p>Aula 1:</p></div>
		<div class="cal-data-container 	inside-cal-container">
			<div class="cal-date-label"><p>Inicio:</p></div>
			<div class="cal-date"></div>
			<div class="cal-date-label"><p>Fim:</p></div>
			<div class="cal-date"></div>
		</div>
	</div>
	
	<div class="cal-container">
		<div class="cal-class-label 	inside-cal-container"><p>Aula 2:</p></div>
		<div class="cal-data-container 	inside-cal-container">
			<div class="cal-date-label"><p>Inicio:</p></div>
			<div class="cal-date"></div>
			<div class="cal-date-label"><p>Fim:</p></div>
			<div class="cal-date"></div>
		</div>
	</div>
	-->
</div>





<div id="offerInfoDialog" class="dialog" title="">
	<div id="offerInfoContainer">
		<div class="rb-label">
			<p>Preço:</p>
		</div>
		<div class="content price">
			<p>80 euros</p>
		</div>
		<div class="rb-label">
			<p>Nível:</p>
		</div>
		<div class="content level">
			<p>beginner</p>
		</div>
		<!--  
		<div class="content spots">
			<p>Existem X vagas disponiveis de um total de Y </p>
		</div>
		-->
		<div class="description">
			<p>Descrição</p>
		</div>
		
	</div>
</div>

<p>
<?php 

?>
</p>

